<script setup lang="ts">

import {onMounted, ref} from "vue";

const props = defineProps({
    content:{
        type: String, default: ""
    }
})

const show = defineModel({
    type: Boolean, default: false
})

const iframeRef = ref()

onMounted(()=>{
    if (iframeRef.value){
        const idoc = iframeRef.value.contentWindow.document;
        console.log(idoc);
        idoc.open();
        idoc.write(props.content);
        idoc.close();
    }
})

</script>

<template>
    <el-dialog v-model="show" class="iframe-error" :width="900">
        <iframe ref="iframeRef" style="width: 100%; height:100%"></iframe>
    </el-dialog>
</template>

<style scoped>
.iframe-error{
    min-height: 500px;
    max-height: calc(100% - 100px);
}
</style>
